require("common/vendor.js"), (global.webpackJsonp = global.webpackJsonp || []).push([ [ "xg_o2o/personnel/personnel_edithead" ], {
    "003f": function(e, t, o) {},
    "026c": function(e, t, o) {
        "use strict";
        o.d(t, "b", function() {
            return r;
        }), o.d(t, "c", function() {
            return i;
        }), o.d(t, "a", function() {
            return n;
        });
        var n = {
            gracePage: function() {
                return o.e("graceUI/components/gracePage").then(o.bind(null, "1915"));
            }
        }, r = function() {
            this.$createElement, this._self._c;
        }, i = [];
    },
    "0a33": function(e, t, o) {
        "use strict";
        var n = o("003f");
        o.n(n).a;
    },
    "273e": function(e, t, o) {
        "use strict";
        o.r(t);
        var n = o("580f"), r = o.n(n);
        for (var i in n) "default" !== i && function(e) {
            o.d(t, e, function() {
                return n[e];
            });
        }(i);
        t.default = r.a;
    },
    "580f": function(e, t, o) {
        "use strict";
        (function(e) {
            Object.defineProperty(t, "__esModule", {
                value: !0
            }), t.default = void 0;
            var n = function(e) {
                return e && e.__esModule ? e : {
                    default: e
                };
            }(o("bf05")), r = {
                data: function() {
                    return {
                        showBack: !1,
                        uploadServerUrl: "",
                        status: 0,
                        WeCropper: null,
                        width: 300,
                        height: 500,
                        topHeight: 64,
                        cropperSets: {
                            height: 500,
                            width: 300,
                            id: "bgCropper",
                            targetId: "prevCropper",
                            scale: 2.5,
                            zoom: 8,
                            cut: {
                                x: 0,
                                y: 0,
                                width: 200,
                                height: 200
                            }
                        }
                    };
                },
                onLoad: function(e) {
                    var t = this;
                    this.uploadServerUrl = this.$xRequest.url("entry/wxapp/v4uploadimg") + "perid=" + e.perid;
                    var o = getCurrentPages();
                    this.showBack = o.length > 1;
                    var r = this.$xSign.sign("v4personnelset");
                    this.$xRequest.request({
                        url: "entry/wxapp/v4personnelset",
                        data: {
                            xgsign: r,
                            op: "checkstatus"
                        },
                        success: function(e) {
                            t.status = 1;
                            var o = t.$systemInfo.info();
                            t.width = o.windowWidth, t.topHeight = o.statusBarHeight + 44, t.height = o.windowHeight - 50 - o.iPhoneXBottomHeightPx - t.topHeight, 
                            t.cropperSets.width = t.width, t.cropperSets.height = t.height, t.cropperSets.pixelRatio = o.pixelRatio, 
                            t.cropperSets.cut.x = (t.width - t.cropperSets.cut.width) / 2, t.cropperSets.cut.y = (t.height - t.cropperSets.cut.height) / 2, 
                            t.WeCropper = new n.default(t.cropperSets);
                        },
                        fail: function(e) {
                            t.$toIndex();
                        }
                    });
                },
                methods: {
                    selectImg: function() {
                        var t = this;
                        e.chooseImage({
                            count: 1,
                            sizeType: [ "compressed" ],
                            sourceType: [ "album", "camera" ],
                            success: function(e) {
                                t.WeCropper.pushOrign(e.tempFilePaths[0]);
                            }
                        });
                    },
                    touchStart: function(e) {
                        this.WeCropper.touchStart(e);
                    },
                    touchMove: function(e) {
                        this.WeCropper.touchMove(e);
                    },
                    touchEnd: function(e) {
                        this.WeCropper.touchEnd(e);
                    },
                    saveImg: function() {
                        var t = this;
                        e.showLoading({
                            mask: !0,
                            title: ""
                        }), this.WeCropper.getCropperImage(function(o) {
                            o ? e.uploadFile({
                                url: t.uploadServerUrl,
                                filePath: o,
                                name: "img",
                                success: function(t) {
                                    "ok" != (t = JSON.parse(t.data)).status ? e.showToast({
                                        title: "上传失败 : " + t.data,
                                        icon: "none"
                                    }) : (e.setStorageSync("onshowHeadimg", 1), e.showModal({
                                        title: "温馨提示",
                                        content: "上传成功",
                                        showCancel: !1,
                                        confirmText: "确定",
                                        success: function(t) {
                                            e.navigateBack({
                                                delta: 1
                                            });
                                        }
                                    }));
                                },
                                fail: function(t) {
                                    e.showToast({
                                        title: "上传失败，请重试",
                                        icon: "none"
                                    });
                                }
                            }) : console.log("获取图片地址失败，请稍后重试"), e.hideLoading();
                        });
                    }
                }
            };
            t.default = r;
        }).call(this, o("543d").default);
    },
    "5bc1": function(e, t, o) {
        "use strict";
        (function(e) {
            function t(e) {
                return e && e.__esModule ? e : {
                    default: e
                };
            }
            o("4e1e"), t(o("66fd")), e(t(o("d69d")).default);
        }).call(this, o("543d").createPage);
    },
    d69d: function(e, t, o) {
        "use strict";
        o.r(t);
        var n = o("026c"), r = o("273e");
        for (var i in r) "default" !== i && function(e) {
            o.d(t, e, function() {
                return r[e];
            });
        }(i);
        o("0a33");
        var c = o("f0c5"), s = Object(c.a)(r.default, n.b, n.c, !1, null, null, null, !1, n.a, void 0);
        t.default = s.exports;
    }
}, [ [ "5bc1", "common/runtime", "common/vendor", "xg_o2o/personnel/common/vendor" ] ] ]);